package com.tw.management.service;

import java.util.List;

import com.tw.management.entity.User;

/**
 * 
 * @author TangW
 * @version 1.0
 *
 */
public interface UserService {

	/**
	 * find user by id
	 * 
	 * @param id
	 * @return
	 */
	public User findUserById(Long id);

	/**
	 * find user by username
	 * 
	 * @param email
	 * @return
	 */
	public User findUserByEmail(String email);

	/**
	 * find user by username and password
	 * 
	 * @param username
	 * @param password
	 * @return
	 */
	public User findUserByEmailAndPassword(String email, String password);

	/**
	 * list all user
	 * 
	 * @return
	 */
	public List<User> listUsers();

	/**
	 * save user
	 * 
	 * @param user
	 * @return
	 */
	public User saveUser(User user);

	/**
	 * update user's info
	 * 
	 * @param user
	 * @return
	 */
	public int updateUserInfo(User user);

	/**
	 * update user's password
	 * 
	 * @param user
	 * @return
	 */
	public int updateUserPassword(User user);

	/**
	 * delete user by id
	 * 
	 * @param id
	 */
	public void deleteById(Long id);

}
